//
//  CommonClass.h
//  ChaoDaiBao
//
//  Created by EIMS-IOS on 16/1/21.
//  Copyright (c) 2016年 EIMS. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "UserInfo.h"
#import "NSString+UserInfo.h"
#import "NSString+Shove.h"

@interface CommonClass : NSObject

// 延时
+ (void)completion:(void (^)(bool finish))completion afterDelay:(CGFloat)delay;

// 设置可变字体
+ (void)setAttributedString:(UILabel *)label rangeStr:(NSString *)rangeStr color:(UIColor *)color font:(UIFont *)font;

//获取文字宽高
+ (CGSize)getSizeOfString:(NSString *)string maxWidth:(float)width maxHeight:(float)height withFont:(UIFont *)font;

// 设置字体间距
+ (void)setAttributedString:(UILabel *)label lineSpace:(CGFloat)lineSpace;

//字符串加星号
+ (NSString *)stringToAsterisk:(NSString*)str startIndex:(NSInteger)startIndex endIndex:(NSInteger)endIndex;

//获取加星后的用户名
+ (NSString *)getAsteriskUserName;


//给图片设置颜色
+ (UIImage *)imageWithColor:(UIColor *)color;

// 去掉 html字符串中所有标签
+ (NSString *)filterHTML:(NSString *)html;

// 抖动动画
+ (void)shakeAnimationForView:(UIView *) view;

// 获取最近的年份
+ (NSArray *)getLatesNumbserYears:(NSInteger)num;

//获取增加天数后的日期
+ (NSDate *)getCalculateDay:(NSInteger)day InDate:(NSDate *)date;

//获取某个日期所在年份的天数
+ (NSUInteger)getNumberOfDaysOneYear:(NSDate *)date;

//获取当某个日期所在月份天数
+ (NSUInteger)getNumberOfDaysOneMonth:(NSDate *)date;

//单位转让
+ (NSString *)unitConversion:(double)amount;

//获取金额单位
+ (NSString *)getAmountUnit:(CGFloat)amount;

//金额格式转让
+ (NSString *)formatConversion:(double)amount type:(NSInteger)type;

//图片路径转换
+ (NSString *)getImageUrlPath:(NSString *)path;

//分享设置
+ (void)shareWithTitle:(NSString *)title Url:(NSString *)url content:(NSString *)content image:(id)image;

////界面自动适配
//+ (void)scaleAutoLayouts:(UIView *)LayoutsBaseView;
//
////字体自动适配
//+ (void)scaleFontSize:(UIView *)LayoutsBaseView;

//获取今天周几
+ (NSInteger)getCurrentWeekDay;

//检测获取的日期是否已到期
+ (BOOL)isExpiredWithDate:(NSString *)value;

/**
 *  登陆成功后处理返回数据
 *
 *  @param dict 返回的数据源
 *
 *  @return 返回处理过后的model
 */
+ (UserInfo *)loginSuccessWithDictionary:(NSDictionary *)obj;

/**
 *  按钮可否点击
 *
 *  @param button 来源
 *  @param enable 是否可以点击
 */
+ (void)buttonEnableWithButton:(UIButton *)button enable:(BOOL)enable;


+ (NSString *)setBankLogoImageWithBankName:(NSString *)bankNameStr imageView:(UIImageView *)logoImageView;

@end
